<!--
 * @Description: 
 * @Version: 1.0
 * @Autor: gaoluo
 * @Date: 2022-04-28 19:00:17
 * @LastEditors: gaoluo
 * @LastEditTime: 2022-05-23 11:23:36
 * @FilePath: /vue3.0-vite-ts-xiaotuxian/src/components/model.vue
-->
<template>
  <div>
    <input type="text" :value="modelValue" @input="update" />
  </div>
</template>

<script setup lang="ts">
// interface IModifiers {
//   bbbb?: boolean;
//   aaaa?: boolean;
// }

interface Props {
  modelValue: string;
  // modelModifiers?: IModifiers;
}

interface Emits {
  (e: "update:modelValue", v: string): void;
}

const { modelValue } = defineProps<Props>();
const emits = defineEmits<Emits>();

const update = (e: Event) => {
  emits("update:modelValue", (e.target as HTMLInputElement).value);
};
</script>

<style scoped></style>
